#include<bits/stdc++.h>
using namespace std;
int bl[21];
int main()
{
	char ch;
	int k = 0;
	while (cin >> ch) {
		if (ch == '@') {
			break;
		}
		if ( ch == ')' && k == 0) { // WA 少算仅右括号在左括号前的情况
			k++;
			break;
		}


		if (ch == '(') {
			bl[k] = 1;
			k ++;
		}
		if (bl[k - 1] == 1 && ch == ')') {
			k--;
			bl[k] = 0;
		}

	}
	if ( k == 0 && bl[k] == 0) {
		cout << "YES";
	} else {
		cout << "NO";
	}


	return 0;
}
